<template>
  <div class="app-container">
    <!-- 基础信息 -->
    <h5 class="titleInfo">基础信息</h5>
    <el-form class="form" ref="form"  label-width="130px">
      <el-row>
        <el-col :span="12">
          <el-form-item label="手机号">
            <span class="spanToInput">{{list.username | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="昵称">
            <span class="spanToInput">{{list.nickName?list.nickName:'暂无数据'}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="姓名">
            <span class="spanToInput">{{list.realname ?list.realname:'暂无数据' }}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="交钱分公司">
            <span class="spanToInput">{{list.branchName | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="级别">
            <span class="spanToInput">{{list.roleId | roleFn}}</span>
          </el-form-item>
        </el-col>
        <!-- {{list.type}} -->
        <el-col :span="12">
          <el-form-item label="账户类型">
            <span class="spanToInput">{{form.type | accountType}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="加盟金额">
            <span class="spanToInput">{{list.joinAmount | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="推荐码">
            <span class="spanToInput">{{list.superCode | filterNull}}</span>
          </el-form-item>
        </el-col>
      </el-row>

      <!-- 推荐人信息 -->
      <div class="divBar"></div>
      <h5 class="titleInfo">推荐人信息</h5>

      <el-row>
        <el-col :span="12">
          <el-form-item label="推荐人姓名">
            <span class="spanToInput">{{list.referName | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="推荐人手机号">
            <span class="spanToInput">{{list.referPhone | filterNull}}</span>
          </el-form-item>
        </el-col>
      </el-row>

      <!-- 实名认证信息 -->
      <div class="divBar"></div>
      <h5 class="titleInfo">实名认证信息</h5>

     
      <el-row>
        <el-col :span="12">
          <el-form-item label="证件类型">
            <span v-if="list.userIdentityAuth">{{list.userIdentityAuth.identityType | cardNull}}</span>
            <span v-else>暂无数据</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="证件号码">
            <span class="spanToInput" v-if="list.userIdentityAuth">{{list.userIdentityAuth.identity | filterNull}}</span>
            <span v-else>暂无数据</span>
          </el-form-item>
        </el-col>
      </el-row>

      <!-- 银行卡信息 -->
      <div class="divBar"></div>
      <h5 class="titleInfo">银行卡信息</h5>

      <el-row>
        <!-- <el-col :span="12">
          <el-form-item label="银行名称">
            <span
              class="spanToInput"
              v-if="list.bankName.length"
            >{{list.banksDTOList[0].name | filterNull}}</span>
            <span class="spanToInput" v-else>暂无数据</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="银行卡号">
            <span
              class="spanToInput"
              v-if="list.banksDTOList.length"
            >{{list.banksDTOList[0].card | filterNull}}</span>
            <span class="spanToInput" v-else>暂无数据</span>
          </el-form-item>
        </el-col> -->
        <el-col :span="12">
          <el-form-item label="银行名称">
   
            <span
              class="spanToInput"
              v-if="list.bankName"
            >{{list.bankName | filterNull}}</span>
            <span class="spanToInput" v-else>暂无数据</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="银行卡号">
            <span
              class="spanToInput"
              v-if="list.cardSn"
            >{{list.cardSn | filterNull}}</span>
            <span class="spanToInput" v-else>暂无数据</span>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>
<script>
import { getList, getInfo } from "@/api/designerManage";
export default {
  name: "designerManageInfo",
  data() {
    return {
      form: null,
      list: {
        referName: "",
        referPhone: "",
        banksDTOList: {
          name: "",
          card: ""
        }
      },
      userId: null
    };
  },
  created() {
    this.form = JSON.parse(this.$route.query.userId);
    this.userId = this.form.userId;
  },
  filters: {
    filterNull(e) {
      if (!e) {
        return "暂无";
      } else {
        return e;
      }
    },
    cardNull(e) {
      return window.helper.cardType(String(e));
    },
    accountType(e){
        return window.helper.accountType(String(e))
    },
    roleFn(e){
      return window.helper.roleFn(String(e))
    }
  },
  mounted() {
    let datas = {
      userId: this.form.userId
    };
    getInfo(datas).then(res => {
      console.log(res.data.data)
      this.list = res.data.data;
    //   console.log(this.list);
    });
  }
};
</script>
<style scoped>
.app-container {
  padding: 0px !important;
}
</style>
